package com.example.ineedahelp;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.View;

import com.netmera.mobile.NetmeraClient;
import com.netmera.mobile.NetmeraException;
import com.netmera.mobile.NetmeraUser;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
		NetmeraClient.init(this, GlobalVariables.apiKey);
		try {
		    NetmeraUser currentUser = NetmeraUser.getCurrentUser();
		     
		    if (currentUser != null) {
                Intent intent = new Intent(getApplicationContext(),HelpActivity.class);
                startActivity(intent);
		    }
		} catch (NetmeraException e) {
		    // Handle Exception
		}
        setContentView(R.layout.activity_main);
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }
    
	public void netmeraLogin(View view){
		Intent intent = new Intent(this,LoginActivity.class);
		startActivity(intent);
	}
	
	public void netmeraRegister(View view){
		Intent intent = new Intent(this,RegisterActivity.class);
		startActivity(intent);
	}
    
}
